{% load dajaxice_templatetags %}
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
	<title>dajaxice simple index</title>
	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
	<script src="http://xmlhttprequest.googlecode.com/svn/trunk/source/XMLHttpRequest.js" type="text/javascript" charset="utf-8"></script>
	{% dajaxice_js_import %}
	<script type="text/javascript" charset="utf-8">
		function example1(){
			Dajaxice.simple.example1('callback_example1');
		}
		function example2(){
			Dajaxice.simple.example2('callback_example2');
		}
		
		function callback_example1(data){
			if(data!='DAJAXICE_EXCEPTION'){
				alert(data.message);
			}
			else{
				alert('Error');
			}
		}
		function callback_example2(data){
			if(data!='DAJAXICE_EXCEPTION'){
				for (var i=0; i < data.numbers.length; i++) {
					alert(data.numbers[i]);
				}
			}
			else{
				alert('Error');
			}
		}
	</script>
</head>
<body>
	<input type="button" name="some_name" value="Call Example 1! (String)" onclick="example1();" id="some_name"><br/>
	<input type="button" name="some_name" value="Call Example 2! (Number list)" onclick="example2();" id="some_name"><br/>
</body>
</html>